﻿import request from '@/utils/request';
import { request as http } from '@/utils/request';

// 查询文章列表
export function articleList(query) {
  return http({
    url: '/article/articleList',
    method: 'get',
    headers: {
      isToken: false,
    },
    params: query,
    isCacel: true,
  });
}

//查询最热文章
export function hotArticleList() {
  return request({
    url: '/article/hotArticleList',
    headers: {
      isToken: false,
    },
    method: 'get',
  });
}

//获取文章详情
export function getArticle(articleId) {
  return request({
    url: '/article/' + articleId,
    headers: {
      isToken: false,
    },
    method: 'get',
  });
}

export function updateViewCount(articleId) {
  return request({
    url: '/article/updateViewCount/' + articleId,
    headers: {
      isToken: false,
    },
    method: 'put',
  });
}
